package view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * Created by Administrator on 2017/2/24.
 */

public class MyVolunteerScrollView extends ScrollView {
    private MyVolunteerScrollViewListener scrollViewListener = null;
    private int situation;

    public int getSituation() {
        return situation;
    }

    public void setSituation(int situation) {
        this.situation = situation;
    }

    public MyVolunteerScrollView(Context context) {
        super(context);
        this.setVerticalScrollBarEnabled(false);
    }

    public MyVolunteerScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.setVerticalScrollBarEnabled(false);
    }

    public MyVolunteerScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.setVerticalScrollBarEnabled(false);
    }
    public void setScrollViewListener(MyVolunteerScrollViewListener scrollViewListener) {
        this.scrollViewListener = scrollViewListener;
    }
    @Override
    protected void onScrollChanged(int x, int y, int oldx, int oldy) {
        super.onScrollChanged(x, y, oldx, oldy);
        if (scrollViewListener != null) {
            scrollViewListener.onScrollChanged(this, x, y, oldx, oldy);
        }
    }
    @Override
    public void fling(int velocityY) {
        super.fling(velocityY);
    }
}
